Platform Limitations on Microsoft Silverlight for Symbian – Beta

Introduction

This document describes the Silverlight 2 features supported on Silverlight for Symbian, platform limitations, and behavior differences. The Silverlight goal is to be fully compatible across all supported desktop browsers and devices. However, there are a number of differences because of hardware limitations, browser differences, and device-specific needs. The following sections introduce these device concepts.

Contents

Supported Features

Browser

Media

Controls

Input

Isolated Storage

Font Support

Networking

Threads

Class Library Support

Known Issues

Supported Features

Microsoft Silverlight for Symbian – Beta supports a subset of Silverlight 2 features. Beginners should be familiar with Silverlight 2.

The following Silverlight 2 features and technologies are not supported in this release:

·          Cryptography

·          Deep Zoom

·          DLR

·          Digital Rights Management (DRM)

·          Expression trees

·          HTML DOM bridge

·          JavaScript programmability

·          LINQ to SQL

·          Localization of Silverlight resources

·          Reflection

·          Sockets

·          Visual Basic

·          Windows Communication Foundation (WCF)

The following Silverlight 2 technologies are supported. However, some features may not be supported, or behavior may be different because of platform differences.

·          Silverlight 2 class library. For more information, see the Class Library Support section of this document.

·          Media. For more information, see the Media section of this document.

·          Controls. For more information, see the Controls section of this document.

·          Input. For more information, see the Input section of this document.

·          Isolated storage. For more information, see the Isolated Storage section of this document.

·          Fonts. For more information, see the Font Support section of this document.

·          Graphics. All features are supported except for VideoBrush.

·          Networking. For more information, see the Networking section of this document.

Browser

This section includes information about browser limitations on the Nokia S60 browser.

No Support for Multiple Plug-ins

Multiple plug-ins on the same page are not supported. It is possible that the current browser page contains a plug-in, and a new browser page is launched which may contain a plug-in. This scenario is not supported and can lead to undefined behavior.

Dynamically Changing Browser Plug-in Source

If you change the plug-in source to a different XAP file after the plug-in has completed loading a Silverlight application, the result is undefined behavior and may cause the browser to crash.

Silverlight Plug-in Object Reference

The Silverlight Plug-in Object reference is not supported in the beta release. However, access to the plug-in using JavaScript is not prohibited.

Custom & Response Headers

Custom headers are not supported by the Nokia S60 browser. Any custom header sent by the application in the HTTP POST request never reaches the server.

The Nokia S60 browser does not support response headers. The code below prints content type as “text/html” instead of “text/html; charset=utf-8”.

HttpWebResponse response = state as HttpWebResponse;

string contentType = response.ContentType;

System.Console.WriteLine(contentType);

Silverlight plug-in not immediately accessible from JavaScript

The Silverlight plug-in is not immediately accessible from JavaScript in the onLoad() event. To work around this issue, you can add a time delay before you access the plug-in.

In the following XAML code, it is assumed that the RunFunc method handles the Loaded event.

<Grid x:Name="LayoutRoot" Background="White" Loaded="RunFunc"></Grid>

Change RunFunc to a time out function such as the following:

<Grid x:Name="LayoutRoot" Background="White" Loaded="TimeoutFunc"></Grid>

TimeoutFunc sets a delay of 200ms before access to the plug-in can occur.

function TimeoutFunc(sender, eventArgs)

{

    setTimeout(function() { RunFunc(sender, eventArgs); }, 200);

}

Updating HTML DOM values thru Managed Code

If you update HTML DOM element values and attributes from managed code, the new values do not take effect on the web page. For example, if the innerHTML attribute is set, the new does not show up on the browser screen. The failure is not evident in managed code.

The following code snippet sets a value that is not displayed on the browser:

HtmlElement _label = HtmlPage.Document.GetElementById("txtLabel");

_label.SetAttribute("innerHTML", "Hello World");

The following code snippet correctly reads the value previously set using managed code. However, it still fails to read the content preset in the HTML tag.

HtmlElement _label = HtmlPage.Document.GetElementById("txtLabel");

string innerText = _label.GetAttribute("innerHTML");

No Timeout Error if Network Goes Down

A timeout error is not generated if there is a network error or the HTTP server goes offline after the download has started. This occurs because the browser does not invoke the NPP_URLNotify() API as expected.

Media

For information on media support on Nokia S60, see the Media on Nokia S60 documentation.

Controls

All controls are supported in this release except for those that are shipped in the Silverlight SDK assemblies. For a list of controls that are not supported, see Class Library Support.

The following controls in Silverlight 2 are supported in this release, although the user may experience usability issues in some cases because of the small screen size.

·          Border

·          Button

·          ContentPresenter

·          Grid

·          Image

·          Clip

·          RenderTransform

·          Slider

·          ValueChanged

·          Stack Panel

·          Thumb

Input

For the TextBox control, the onscreen keyboard appears when the user clicks on the control. The onscreen keyboard supports mini QWERTY and full QWERTY. The T9 keyboard is not supported. The InkPresenter control supports handwriting.

Isolated Storage

The Isolated Storage maximum quota per application is 1 Mb (1048576 bytes). This value is fixed and an application cannot request additional storage space. As a result, the IncreaseQuotaTo API is not supported.

When cleanup is required, Isolated Storage files need to be manually deleted by the user. The device does not provide a UI associated with cleanup. Isolated Storage files are stored in <drive>:\data\Application Data\Microsoft\Silverlight\IS, where <drive> is either E: or C:.

The FileShare.Read enumeration value is not supported. Use of this enumeration value will result in an error. Use the FileShare.Write enumeration value instead. For example, in the following code, the first example fails but the second example succeeds.

IsolatedStorageFile store =

    IsolatedStorageFile.GetUserStoreForApplication();

String s_strTFName = "Co5726ctor_fm_fa_fs_i.cs";

String s_strTFAbbrev = s_strTFName.Substring(0, 6);

String fileName = s_strTFAbbrev + "TestFile.txt";

Stream fs2, fs3;

 

// Example 1 – This code fails.

// Open a stream in FileShare.Read mode; you

// need READ Lock for this

fs2 = new IsolatedStorageFileStream(fileName, FileMode.Create,

    FileAccess.ReadWrite, FileShare.Read, store);

 

// Example 2 – This code succeeds.

// Open a stream in FileShare.ReadWrite mode; you

// need WRITE lock for this.

fs3 = new IsolatedStorageFileStream(fileName, FileMode.Open,

    FileAccess.Read, FileShare.ReadWrite, store);

Font Support

Font support is controlled by the fonts that are already present on the device, and this support is limited to TrueType fonts. No fonts are installed with Silverlight.

If the font that you want is not present on the target platform, we recommend that you deploy it with the application. We recommend that you use the TTF format for the application font.

An embedded font must be added to the DLL or XAP as an embedded resource for the font to be supported by the runtime in managed code scenarios.

Networking

Support for networking features includes the HttpWebRequest and WebClient classes. For information about features that are not supported, see the Class Library Support section of this document.

Note   If you use the HttpWebRequest or WebClient class to download a large amount of content, a failure may occur because of resource exhaustion. To avoid this, we recommend that you use the Dispose method on the download Result object immediately after the download completes.

Threads

ThreadPool is not supported.

Class Library Support

Use the Silverlight.chm Help file in the Silverlight 2 Software Development Kit (SDK) Documentation to find information about classes, methods, and properties that you can use for Silverlight application development.

If you use an unsupported type or member in your Silverlight application, you will get either a MissingMemberException or a TypeLoadException when you run the application.

The following Silverlight 2 assemblies are not supported in this release:

·          Microsoft.VisualBasic.dll

·          System.ServiceModel.dll

·          The following SDK assemblies are not supported:

·          System.Data.Services.Client.dll

·          System.Windows.Controls.dll

·          System.Windows.Controls.Data.dll

·          System.Windows.Controls.Input.dll

The following namespaces are not supported in this release:

·          All namespaces associated with the unsupported assemblies. (See above.)

·          System.Linq.Expressions

·          System.Net.Sockets

·          System.Reflection

·          System.Reflection.Emit

·          System.Security

·          System.Security.Cryptography

·          System.Security.Cryptography.X509Certificates

·          System.Web.UI.Design.SilverlightControls

·          System.Web.UI.SilverlightControls

·          System.Windows.Automation

·          System.Windows.Automation.Peers

·          System.Windows.Automation.Provider

·          System.Windows.Browser

The following types are not supported in this release:

·          All types in unsupported namespaces. (See above.)

·          SDK Controls

·          AutoCompleteBox

·          Calendar

·          ComboBox

·          DataGrid

·          DataPager

·          DatePicker

·          GridSplitter

·          Label

·          TabControl

·          TreeView

·          DeepZoomImageTileSource

·          LicenseAcquirer

·          MultiScaleImage

·          MultiScaleSubImage

·          SocketAddress

·          ThreadPool

·          VideoBrush

The following table lists members in supported types that are either unsupported or behave differently on Nokia S60 5th Edition because of platform differences or differences between the Silverlight runtime for Nokia and the Silverlight runtime for Windows.

Member

Behavior on Nokia S60 5th Edition

System.Threading.WaitHandle.WaitAll()

A call to this method always throws a NotSupportedException.

This restriction applies to all overloaded versions of this method.

System.Threading.WaitHandle.WaitAny()

A call to this method always throws a NotSupportedException.

This restriction applies to all overloaded versions of this method.

System.Threading.Thread.Abort()

The thread is not aborted after you call this method.

System.IO.FileShare.Read

Use of this enumeration value will result in an error. Use the FileShare.Write enumeration value instead. See the section on Isolated Storage for example code.

System.IO.IsolatedStorage.IsolatedStorageFile
    .GetDirectoryNames(string searchPattern)

Including both single-character ("?") and multiple character ("*") wildcards in the searchPattern parameter is not supported.

For example, if you include directoryname* at the end of the search pattern, the search pattern is treated as "*" and the function returns all directory names under the provided isolated storage path.

If you include "*.*" at the end of the search pattern, the search pattern is treated as "*" and the function returns all directory names under the provided isolated storage path.

System.IO.IsolatedStorage
    .IsolatedStorageFile.GetFileNames(
    string searchPattern)

Including both single-character ("?") and multiple character ("*") wildcards in the searchPattern parameter is not supported.

For example, if you include "Project\*.txt" at the end of the search pattern, the search pattern is treated as "Project\*", and the function returns all file names under the Project directory of the isolated storage scope.

System.IO.IsolatedStorage
    .IsolatedStorageFileStream(string,
    FileMode, FileAccess, FileShare,
    IsolatedStorageFile)

FileShare.Read is treated as FileShareWrite.

System.IO.IsolatedStorage
    .IncreaseQuotaTo(Int64 newQuotaSize)

A call to this method always throws a NotSupportedException.

System.Text.RegularExpressions.Regex.CacheSize

The get property always returns 0.

The set property does not set the given value. CacheSize remains 0.

System.TimeZoneInfo.Local.StandardName

System.TimeZoneInfo.Local.DaylightName

System.TimeZoneInfo.Local.DisplayName

Time zone information is not available for these members. The output string is always blank.

Members of System.Windows.Controls.MediaElement

The Play, Stop, and Pause methods are supported. Other methods of MediaElement are not supported in this beta release.

 

Known Issues

The following symptoms may be related to known issues in the Silverlight for Symbian.

·          Browser crashes intermittently

See the Getting Started document for information on setting the object tag in the application.

·          Silverlight for Symbian cannot load large files

Files larger than 1 MB will not load. The Symbian operating system does not allow memory mapping of large files. This typically can impact fonts, JPG files, and XAP files.

·          Unexpected behavior in HTML OnLoad event

See the section, Silverlight plug-in not immediately accessible from JavaScript, in this document.

·          Unexpected behavior when managing focus for the plug-in

Focus- and activity-based events do not occur when expected. Some input and focus events do not occur in a predictable order.

·          Files uploaded using WebClient are corrupted

This is a known issue with some Nokia device and firmware combinations. The bug has been fixed in new firmware that is not yet publicly available.

·          Screen repaint is incomplete after using OpenFileDialog

When OpenFileDialog is dismissed, the following repaint issues can occur:

·          A part of the navigation bar is rendered incompletely on closing the dialog box.

·          If the browser is in full screen mode, and OpenFileDialog is launched and dismissed, then the browser window full screen watermark and the browser navigation bar display simultaneously. The browser assumes that it is still in full screen mode and the user must click the icon to toggle out of this mode.

·          When the repaint issue described previously occurs, the navigation bar belonging to the application that was previously occupying the screen appears. For example, the Contacts button may display.